﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Data;
using Entity;
using Data;

namespace Business
{
    public class Service_Bussiness
    {
        public bool InsertService(Service_Entity serviceprice)
        {
            Service_Data insertser = new Service_Data();
            return insertser.AddService(serviceprice);
        }

        public DataTable Binding()
        {
            Service_Data serviceprice = new Service_Data();
            try
            {
                return serviceprice.Binding();

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                serviceprice = null;
            }
        }

        public int Update(int serID, string sername, int serprice)
        {
            Service_Data updateser = new Service_Data();
            try
            {
                return updateser.UpdateService(serID, sername, serprice);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally 
            {
                updateser = null;
            }
        }

        public int Delete(int serID)
        {
            Service_Data delser = new Service_Data();
            try
            {
                return delser.DeleteService(serID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                delser = null;
            }
        }
    }
}
